package com.xm.service.module.BOOK.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.xm.service.module.BOOK.mapper.BookMapper;
import com.xm.service.module.BOOK.po.Book;
import com.xm.service.module.BOOK.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;


@Service
public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements BookService {

    @Autowired
    private BookMapper bookMapper;
    @Override
    public Book getById(int id) {
        return bookMapper.getById(id);
    }

    @Override
    public Boolean deleteById(int id) {
        return bookMapper.deleteBookById(id)==1;
    }

    @Override
    public Boolean updateById(int id,int stock) {
        return bookMapper.updateBookStockById(id,stock)==1;
    }


}
